<div class="wrap" id="wrap" style="margin-top:-5px;">
    <script>
        var tests = "${testQuestionsInfoList}".split("TestQuestionsInfo");
        var j = "${testQuestionsInfoListl}";
        while (j > 0) {
            document.getElementById("wrap").insertAdjacentHTML("afterBegin",//            beforeEnd
                "    <div class=\"item\"> </br>" +
                "           <div class=\"card-views\" style=\"margin-left:16px;margin-right:16px\"> " +
                "                <div class=\"card-view\"><span class=\"title\" style=\"text-align: center; vertical-align: middle; \"></span><span " +
                "   s                 class=\"value\">" + tests[j].split("testNumber='")[1].split("testQuestionsId")[0].split("'")[0] + "." + tests[j].split("testTitle='")[1].split("testQuestionsId")[0].split("'")[0] + "</span></div> </br>" +
                "            <div class=\"card-view\" id=\"radio1A" + j + "\"><span class=\"title\" " +
                "                                         style=\"text-align: center; vertical-align: middle; \"><input type=\"radio\" name=\"payMethod" + j + "\" onclick=\" fun('radioA" + j + "')\" id=\"radioA" + j + "\" value=" + tests[j].split(", testTitle='")[0].split("id=")[1] + ",A  /></span><span " +
                "                    class=\"value\">A：" + tests[j].split("optionsA='")[1].split("testQuestionsId")[0].split("'")[0] + "</span></div> </br>" +
                "            <div class=\"card-view\" id=\"radio1B" + j + "\"><span class=\"title\" " +
                "                                         style=\"text-align: center; vertical-align: middle; \"><input type=\"radio\" name=\"payMethod" + j + "\" onclick=\" fun('radioB" + j + "')\" id=\"radioB" + j + "\" value=" + tests[j].split(", testTitle='")[0].split("id=")[1] + ",B /></span><span " +
                "                    class=\"value\">B：" + tests[j].split("optionsB='")[1].split("testQuestionsId")[0].split("'")[0] + "</span></div> </br>" +
                "            <div class=\"card-view\" id=\"radio1C" + j + "\"><span class=\"title\" " +
                "                                         style=\"text-align: center; vertical-align: middle; \"><input type=\"radio\" name=\"payMethod" + j + "\" onclick=\" fun('radioC" + j + "')\" id=\"radioC" + j + "\" value=" + tests[j].split(", testTitle='")[0].split("id=")[1] + ",C /></span><span" +
                "                    class=\"value\">C：" + tests[j].split("optionsC='")[1].split("testQuestionsId")[0].split("'")[0] + "</span></div> </br>" +
                "            <div class=\"card-view\" id=\"radio1D" + j + "\"><span class=\"title\" " +
                "                                         style=\"text-align: center; vertical-align: middle; \"><input type=\"radio\" name=\"payMethod" + j + "\" onclick=\" fun('radioD" + j + "')\" id=\"radioD" + j + "\" value=" + tests[j].split(", testTitle='")[0].split("id=")[1] + ",D /></span><span" +
                "                    class=\"value\">D：" + tests[j].split("optionsD='")[1].split("testQuestionsId")[0].split("'")[0] + "</span></div> </br>" +
                "            <div class=\"card-view\" id=\"radio1E" + j + "\"><span class=\"title\" " +
                "                                         style=\"text-align: center; vertical-align: middle; \"><input type=\"radio\" name=\"payMethod" + j + "\" onclick=\" fun('radioE" + j + "')\" id=\"radioE" + j + "\" value=" + tests[j].split(", testTitle='")[0].split("id=")[1] + ",E /></span><span " +
                "                    class=\"value\">E：" + tests[j].split("optionsE='")[1].split("testQuestionsId")[0].split("'")[0] + "</span></div> </br>" +
                "            <div class=\"card-view\" style=\"display: none\"><span class=\"title\" style=\"text-align: center; vertical-align: middle; \"></span>正确答案：<span " +
                "                    class=\"value\">" + tests[j].split("correctAnswer='")[1].split("testQuestionsId")[0].split("'")[0] + "</span></div> ");
            document.getElementById("a" + j + "").value = tests[j].split("userAnswer='")[1].split("testQuestionsId")[0].split("'")[0];
            j--;
        }
        var myslider = new iSlider({
            wrap: '#wrap',
            isVertical: false,
            speed: 500,
            onslide: function (index) {
                var indexs = index + 1;
                var isChoose = 1;
                document.getElementById("numbers").innerHTML = "" + indexs + "/${testQuestionsInfoListl}";
                $("#radio1A" + indexs + "").click(function () {
                    document.getElementById("radio1A" + indexs + "").style.background = "blue";
                    document.getElementById("radioA" + indexs + "").checked = true;
                    document.getElementById("a" + indexs + "").value = "A";
                    document.getElementById("radio1B" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1C" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1D" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1E" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1A" + indexs + "").style.background = "blue";
                    $.ajax({
                        url: "${ctxPath}/answerList/updates",
                        type: "post",
                        data: {
                            "id": document.getElementById("radioA" + indexs + "").value.split(",")[0],
                            "userAnswer": "A"
                        },
                        success: function (data) {
                            isChoose = isChoose + 1;
                            if (isChoose == 2) {
                                myslider.next();
                            }
                        },
                        error: function (data) {
                            alert('错误!');
                        }
                    });
                });
                $("#radio1B" + indexs + "").click(function () {
                    document.getElementById("radio1B" + indexs + "").style.background = "blue";
                    document.getElementById("radioB" + indexs + "").checked = true;
                    document.getElementById("a" + indexs + "").value = "B";
                    document.getElementById("radio1A" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1C" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1D" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1E" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1B" + indexs + "").style.background = "blue";
                    $.ajax({
                        url: "${ctxPath}/answerList/updates",
                        type: "post",
                        data: {
                            "id": document.getElementById("radioA" + indexs + "").value.split(",")[0],
                            "userAnswer": "B"
                        },
                        success: function (data) {
                            isChoose = isChoose + 1;
                            if (isChoose == 2) {
                                myslider.next();
                            }
                        },
                        error: function (data) {
                            alert('错误!');
                        }
                    });
                });
                $("#radio1C" + indexs + "").click(function () {
                    document.getElementById("radio1C" + indexs + "").style.background = "blue";
                    document.getElementById("radioC" + indexs + "").checked = true;
                    document.getElementById("a" + indexs + "").value = "C";
                    document.getElementById("radio1B" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1A" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1D" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1E" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1C" + indexs + "").style.background = "blue";
                    $.ajax({
                        url: "${ctxPath}/answerList/updates",
                        type: "post",
                        data: {
                            "id": document.getElementById("radioA" + indexs + "").value.split(",")[0],
                            "userAnswer": "C"
                        },
                        success: function (data) {
                            isChoose = isChoose + 1;
                            if (isChoose == 2) {
                                myslider.next();
                            }
                        },
                        error: function (data) {
                            alert('错误!');
                        }
                    });
                });
                $("#radio1D" + indexs + "").click(function () {
                    document.getElementById("radio1D" + indexs + "").style.background = "blue";
                    document.getElementById("radioD" + indexs + "").checked = true;
                    document.getElementById("a" + indexs + "").value = "D";
                    document.getElementById("radio1B" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1C" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1A" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1E" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1D" + indexs + "").style.background = "blue";
                    $.ajax({
                        url: "${ctxPath}/answerList/updates",
                        type: "post",
                        data: {
                            "id": document.getElementById("radioA" + indexs + "").value.split(",")[0],
                            "userAnswer": "D"
                        },
                        success: function (data) {
                            isChoose = isChoose + 1;
                            if (isChoose == 2) {
                                myslider.next();
                            }
                        },
                        error: function (data) {
                            alert('错误!');
                        }
                    });
                });
                $("#radio1E" + indexs + "").click(function () {
                    document.getElementById("radio1E" + indexs + "").style.background = "blue";
                    document.getElementById("radioE" + indexs + "").checked = true;
                    document.getElementById("a" + indexs + "").value = "E";
                    document.getElementById("radio1B" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1C" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1D" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1A" + indexs + "").style.background = "bottom";
                    document.getElementById("radio1E" + indexs + "").style.background = "blue";
                    $.ajax({
                        url: "${ctxPath}/answerList/updates",
                        type: "post",
                        data: {
                            "id": document.getElementById("radioA" + indexs + "").value.split(",")[0],
                            "userAnswer": "E"
                        },
                        success: function (data) {
                            isChoose = isChoose + 1;
                            if (isChoose == 2) {
                                myslider.next();
                            }
                        },
                        error: function (data) {
                            alert('错误!');
                        }
                    });
                });
                var as = document.getElementById("a" + indexs + "").value;
                if (as != null || as != "") {
                    document.getElementById("radio" + as + indexs + "").checked = true;
                    document.getElementById("radio1" + as + indexs + "").style.background = "blue";
                }
            }
        });

        function fun(str) {
            var strs = document.getElementById(str).value.split(",");
            document.getElementById("a" + str.substr(6, str.length) + "").value = strs[1];
            document.getElementById("radio1A" + str.substr(6, str.length) + "").style.background = "bottom";
            document.getElementById("radio1B" + str.substr(6, str.length) + "").style.background = "bottom";
            document.getElementById("radio1C" + str.substr(6, str.length) + "").style.background = "bottom";
            document.getElementById("radio1D" + str.substr(6, str.length) + "").style.background = "bottom";
            document.getElementById("radio1E" + str.substr(6, str.length) + "").style.background = "bottom";
            document.getElementById("radio1" + str.substr(5, 6) + "").style.background = "blue";
            displayDate(strs);
        };

        function displayDate(strs) {
            $.ajax({
                url: "${ctxPath}/answerList/updates",
                type: "post",
                data: {
                    "id": strs[0],
                    "userAnswer": strs[1]
                },
                success: function (data) {
                    myslider.next();
                },
                error: function (data) {
                    alert('错误!');
                }
            });
        };
    </script>
</div>